package org.group6.view;

import javax.swing.DefaultListModel;
import javax.swing.DefaultListSelectionModel;
import javax.swing.ListModel;

/**
 *
 * @author Kseniya
 */
public class PanelInfo extends javax.swing.JPanel {

    /**
     * Creates new form PanelInfo
     */
    public PanelInfo() {
        initComponents();
    }

    /**
     * This method is called from within the constructor to initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is always
     * regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {
        java.awt.GridBagConstraints gridBagConstraints;

        jLabelGroup = new javax.swing.JLabel();
        jScrollPaneGroupInfo = new javax.swing.JScrollPane();
        jListGroupInfo = new javax.swing.JList<String>();

        setMinimumSize(new java.awt.Dimension(300, 200));
        setPreferredSize(new java.awt.Dimension(300, 200));
        setLayout(new java.awt.GridBagLayout());

        jLabelGroup.setFont(new java.awt.Font("Tahoma", 1, 18)); // NOI18N
        jLabelGroup.setText("Gruppe 6:");
        add(jLabelGroup, new java.awt.GridBagConstraints());

        jScrollPaneGroupInfo.setBorder(null);

        jListGroupInfo.setBackground(this.getBackground());
        jListGroupInfo.setModel(new javax.swing.AbstractListModel() {
            String[] strings = { "Oleg Hoefling (306176)" };
            public int getSize() { return strings.length; }
            public Object getElementAt(int i) { return strings[i]; }
        });
        jListGroupInfo.setSelectionModel(new ListModelNoSelection());
        jScrollPaneGroupInfo.setViewportView(jListGroupInfo);

        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 0;
        gridBagConstraints.gridy = 1;
        add(jScrollPaneGroupInfo, gridBagConstraints);
    }// </editor-fold>//GEN-END:initComponents
    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JLabel jLabelGroup;
    private javax.swing.JList<String> jListGroupInfo;
    private javax.swing.JScrollPane jScrollPaneGroupInfo;
    // End of variables declaration//GEN-END:variables

    /**
     * A dummy replacement of selection model that skips the selection in a
     * list.
     */
    private class ListModelNoSelection extends DefaultListSelectionModel {

        @Override
        public void addSelectionInterval(int index0, int index1) {
            // do nothing
        }

        @Override
        public boolean isSelectedIndex(int index) {
            return false;
        }

        @Override
        public int getAnchorSelectionIndex() {
            return -1;
        }

        @Override
        public int getLeadSelectionIndex() {
            return -1;
        }

        @Override
        public int getMaxSelectionIndex() {
            return -1;
        }

        @Override
        public int getMinSelectionIndex() {
            return -1;
        }
        
        

        @Override
        public boolean isSelectionEmpty() {
            return false;
        }
    }
}
